﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Cart.ascx.cs" Inherits="user_control_Cart" %>
   <style type="text/css">
       .style1
       {
       }
   </style>
   <script type="text/javascript">
	function show_alert()
	{
	    Textbox1.Text="abc";
	}
</script>
        <table style="width:100%;">
            <tr>
                <td colspan="4" style="text-align: right">
    
        <asp:GridView ID="grProduct" runat="server" PageSize="5" 
            onrowdeleting="grProduct_RowDeleting" AutoGenerateColumns="False" 
    CellPadding="4" Font-Bold="False" ForeColor="#333333" GridLines="None" 
                        onpageindexchanging="grProduct_PageIndexChanging" style="text-align: left" Width="489px" 
            >
            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
        <Columns>  
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:CheckBox ID="chkRemove" runat="server" />
                </ItemTemplate>
            </asp:TemplateField>
      
    <asp:TemplateField HeaderText="STT">  
    <ItemTemplate>  
        <%# STT() %>  
    </ItemTemplate>  
        <ControlStyle BackColor="#993333" ForeColor="#CC0000" />
    </asp:TemplateField>  
      
        <asp:BoundField DataField="ProID" HeaderText="ProID" Visible="False" />
                <asp:BoundField DataField="ProName" HeaderText="Product name" />
            <asp:TemplateField HeaderText="Image">
                <ItemTemplate>
                    <asp:Image ID="Image1" runat="server" Height="60px" 
                        ImageUrl='<%# Eval("ProImage","~/picture/{0}") %>' Width="80px" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="ProPrice" HeaderText="Price" />
            <asp:TemplateField HeaderText="Quantity">
                <ItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Height="18px" 
                        Text='<%# GetSoLuongByProId(Eval("ProID")) %>' Width="43px" 
                        ontextchanged="TextBox1_TextChanged"></asp:TextBox>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Total Price">
                <ItemTemplate>
                    <asp:Label ID="Label6" runat="server" 
                        Text='<%# GetTotalPrice(Eval("ProID")) %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
      
            <asp:TemplateField ShowHeader="False">
                <ItemTemplate>
                    <asp:ImageButton ID="ImageButton2" runat="server" CommandName="Delete" 
                        ImageUrl="~/images/deletered.png" Width="20px" />
                </ItemTemplate>
            </asp:TemplateField>
      
    </Columns>  
            <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
            <EmptyDataTemplate>
                <asp:Label ID="lbEmptyData" runat="server" Font-Bold="True" Font-Size="X-Large" 
                    ForeColor="#CC0000" Text="Shop Cart is empty!"></asp:Label>
            </EmptyDataTemplate>
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
    
    
                </td>
            </tr>
            <tr>
            <td>
            
                <asp:ImageButton ID="ibtnRemoveSelection" runat="server" 
                    ImageUrl="~/images/deletered.png" onclick="ibtnRemoveSelection_Click" 
                    Width="25px" />
            
            </td>
                <td colspan="4" style="text-align: right">
    
                    <asp:Label ID="Label8" runat="server" Text="Sum Price: " Font-Bold="True" 
                        Font-Size="Small"></asp:Label>
&nbsp;<asp:Label ID="lbSumPrice" runat="server" Font-Bold="True" ForeColor="#990033" 
                        Font-Size="Medium"></asp:Label></td>
            </tr>
            <tr>
                <td colspan="4" style="text-align: right" valign="middle">
    
                    <asp:ImageButton ID="ImageButton1" runat="server" 
                        ImageUrl="~/images/button-seagreen_benji_pa_01.PNG" 
                        onclick="ImageButton1_Click" Width="40px" />
&nbsp;&nbsp;&nbsp;
    
                    <asp:ImageButton ID="ibtnUpdate" runat="server" 
                        ImageUrl="~/images/button-yellow_benji_park_01.PNG" onclick="ibtnUpdate_Click" 
                        Width="40px" />
    
    
                </td>
            </tr>
            <tr>
                <td width="20%">
                    <asp:Label ID="Label7" runat="server" Font-Bold="True" Font-Size="Small" 
                        Text="Type Payment: "></asp:Label>
                </td>
                <td width="20%">
                    &nbsp;</td>
                <td class="style1">
                    <asp:DropDownList ID="drdlPayment0" runat="server" DataSourceID="SqlDataSource1" 
                        DataTextField="PayType" DataValueField="PayID">
                    </asp:DropDownList>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style1" colspan="3">
                    <asp:ImageButton ID="ImageButton3" runat="server" 
                        ImageUrl="~/images/button-red_benji_park_01.PNG" onclick="ImageButton3_Click" 
                        Width="40px" />
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style1" colspan="4">
                    Neu ban muon chuyen den dia chi khac voi dia chi ban da dang ky vui long an vao
                    <asp:LinkButton ID="lbtnOtherAdd" runat="server" ForeColor="#CC0000" 
                        onclick="lbtnOtherAdd_Click">day</asp:LinkButton>
                </td>
            </tr>
            <tr>
                <td class="style1" colspan="4">
                    &nbsp;</td>
                </tr>
            <tr>
                <td class="style1" colspan="4">
                    <asp:Panel ID="pnOtherAdd" runat="server" Visible="False">
                        <table style="width:100%;">
                            <tr>
                                <td colspan="2">
                                    <hr />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="Label2" runat="server" Font-Bold="True" Font-Size="Small" 
                                        Text="Name: "></asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtName" runat="server" Width="320px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="Label3" runat="server" Font-Bold="True" Font-Size="Small" 
                                        Text="Address: "></asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtAddress" runat="server" Rows="5" TextMode="MultiLine" 
                                        Width="324px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="Label4" runat="server" Font-Bold="True" Font-Size="Small" 
                                        Text="Phone: "></asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtPhone" runat="server" Width="319px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="Label5" runat="server" Font-Bold="True" Font-Size="Small" 
                                        Text="Type Payment: "></asp:Label>
                                </td>
                                <td>
                                    <asp:DropDownList ID="drdlPayment" runat="server" DataSourceID="SqlDataSource1" 
                                        DataTextField="PayType" DataValueField="PayID">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:ImageButton ID="ImageButton4" runat="server" 
                                        ImageUrl="~/images/button-red_benji_park_01.PNG" onclick="ImageButton4_Click" 
                                        Width="40px" />
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                        </table>
                    </asp:Panel>
                </td>
            </tr>
            </table>


    
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ShopLaptopConnectionString %>" 
    SelectCommand="SELECT * FROM [payment]"></asp:SqlDataSource>



    
    